﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Visitor.master" AutoEventWireup="true" CodeFile="TrackConfirm.aspx.cs" Inherits="Visitor_trackconfirm" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">

        .style10
        {
            width: 100%;
        }
        *{ margin: 0 0 0 0px; 
padding: 0;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
}
        .style11
        {
            font-size: x-small;
        }
        .style12
        {
            font-size: small;
        }
 </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="head">
        <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Small" 
            ForeColor="White" Text="Track &amp; Confirm"></asp:Label>
    </div>
    <table class="style10">
        <tr>
            <td colspan="2">
            </td>
        </tr>
        <tr>
            <td align="center" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right" width="450">
                <asp:TextBox ID="txtSearch" runat="server" CssClass="textboxlogin" Height="25px" 
                    Width="250px"></asp:TextBox>
                </td>
            <td align="left" valign="middle">
                <asp:ImageButton ID="ImageButton1" runat="server" 
                    ImageUrl="~/images/bt_find.png" onclick="ImageButton1_Click" 
                    ValidationGroup="Find" />
            </td>
        </tr>
        <tr>
            <td align="right" width="450">
                <asp:Label ID="Label2" runat="server" Font-Size="X-Small" 
                    Text="Enter your id mail or contact number"></asp:Label>
                </td>
            <td align="left" valign="middle">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right" width="450">
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtSearch" ErrorMessage="You must be enter digits" 
                    ForeColor="Red" SetFocusOnError="True" ValidationExpression="[0-9]+" 
                    ValidationGroup="Find" CssClass="style12"></asp:RegularExpressionValidator>
                </td>
            <td align="left" valign="middle">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right" width="450">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtSearch" 
                    ErrorMessage="You did not enter a valid value" ForeColor="Red" 
                    ValidationGroup="Find" CssClass="style12"></asp:RequiredFieldValidator>
                </td>
            <td align="left" valign="middle">
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="2">
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                        SelectCommand="SELECT MailID, DateReceipt, DateDelivery, Status, SenderName FROM Mail WHERE (MailID = @MailID) OR (SenderPhone = @SenderPhone)">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="txtSearch" Name="MailID" PropertyName="Text" />
                            <asp:ControlParameter ControlID="txtSearch" Name="SenderPhone" 
                                PropertyName="Text" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                  
               </td>
        </tr>
        <tr>
            <td colspan="2">
                    &nbsp;</td>
        </tr>
        <tr align="center">
            <td colspan="2">
                <div id="note">
                    <br />
                    <br />
                    <br />
                  
                    <table class="style10">
                        <tr>
                            <td width="120">
                                &nbsp;</td>
                            <td align="left">
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                        DataKeyNames="MailID" DataSourceID="SqlDataSource1" GridLines="None" 
                        Height="50px" Width="340px" 
                                    EmptyDataText="Please enter id mail or contact number again">
                        <Fields>
                            <asp:BoundField DataField="MailID" HeaderText="Mail ID" ReadOnly="True" 
                                SortExpression="MailID" />
                            <asp:BoundField DataField="SenderName" HeaderText="Name" 
                                SortExpression="SenderName" />
                            <asp:BoundField DataField="DateReceipt" HeaderText="Date Receipt" 
                                SortExpression="DateReceipt" />
                            <asp:BoundField DataField="DateDelivery" HeaderText="Date Delivery" 
                                SortExpression="DateDelivery" />
                            <asp:BoundField DataField="Status" HeaderText="Status" 
                                SortExpression="Status" />
                        </Fields>
                    </asp:DetailsView>
                            </td>
                        </tr>
                    </table>
                </div>
             </td>
        </tr>
        </table>
                
           
   
</asp:Content>

